package me.zhengjie.poemQuestions.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.poemQuestions.domain.PoemQuestions;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface PoemQuestionsMapper extends BaseMapper<PoemQuestions> {
    PoemQuestions getRandomQuestion();

    /** 当天答题次数 */
    int countTodayAnswers(@Param("userId") Integer userId);

    /** 随机取一道未答过的题 */
    PoemQuestions getRandomUnansweredQuestion(@Param("userId") Integer userId);
}
